<%inherit file="/wml/base.mako" />

<template>
	<do name="back" type="prev" label="Back">
		<prev/>
	</do>
</template>

	<card id="messages" title="Messages in ${c.folder}">
		<do type="options" label="Actions">
			<go href="#actions" />
		</do>
	% if c.messages:
		% for message in c.messages:
		<p>
			% if message.unread:
			<b>
			% endif
			<a href="${h.url_escape(h.url_for('message_view', fname=message.folder, uid=message.uid))}">${h.header_print(message['Subject'])}</a><br />
			${h.header_print(message['From'])}<br />
			<small>${h.header_print(message['Date'])}</small>
			% if message.unread:
			</b>
			% endif
		</p>
		% endfor
		<p>Messages ${c.messages_start} to ${c.messages_end} of ${c.messages_total}</p>

		% if c.messages_prev:
		<p><a href="${h.url_escape(h.url_for('folder_view', fname=c.folder, page=c.messages_prev))}">Prev</a></p>
		% endif

		% if c.messages_next:
		<p><a href="${h.url_escape(h.url_for('folder_view', fname=c.folder, page=c.messages_next))}">Next</a></p>
		% endif
	% else:
		<p>No messages in this folder.</p>
	% endif
	</card>

	<card id="actions" title="Actions">
	% if c.folders:
		<p><a href="${h.url_for('folder_children', fname=c.folder)}">View subfolders</a></p>
	% else:
		<p>No subfolders found.</p>
	% endif
		<p>Mark visible as &quot;Read&quot;</p>
                <%include file="/wml/common.mako" />
	</card>
